package com.sz.jinzheng.mapper;

import com.sz.jinzheng.model.BillForm;
import com.sz.jinzheng.model.Interest;
import com.sz.jinzheng.model.Result;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface TbillFormMapper {
    public BillForm getAllRepayment(Integer id);//获得用户的所有借款信息来填充到还款界面上

    //    public BillForm getInterest(Integer id);//通过ID查询用户选择的还款方式
    public Interest getInterest(Integer id);//通过ID查询用户选择的还款方式

    public BillForm overtime(Integer id);//查询是否逾期和逾期后的违约率;

    public int insertbill(Integer userId, Integer billFormId, Integer borrowInfoId, Integer whichIssue, Double capital, Double principalAndInterest, Double interest, Integer status, Integer overdueDays, Double penaltyRate, Double penaltyInterest, Date startTime, Date endTime, Date createTime, Date updateTime, Integer isDeleted);

    public List<BillForm> getArrears(Integer borrowInfoId);//查询出来用户欠款信息
    public List<BillForm> getArrears1(Integer borrowInfoId);//查询出来用户欠款信息

    public int updateForm(BillForm billForm);//修改账单

    public int updateFormOverdue(Integer id, Integer status, Integer overdueDays, Double penaltyInterest);//修改账单为逾期

    public BillForm timePayment(Integer whichIssue, Integer borrowInfoId, Integer id);//查询账单通过当前第几期和用户id

    public BillForm getzhangdan(Integer id, Integer whichIssue);//当前月的账单


    /**
     * 用户提前还款成功！
     *
     * @param borrowInfoId 账单id
     * @return
     */
    public int payPrepayment(Integer borrowInfoId);



}
